﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Peak.Core;
using Peak.Resources;

namespace Peak.Web.Controllers.Models
{
  public class UserActivityModel
  {
    public User User { get; set; }
    public List<Task> CurrentTasks { get; set; }
    public List<Task> NextTasks { get; set; }

    public UserActivityModel(User user)
    {
      User = user;
      CurrentTasks = new List<Task>();
      NextTasks = new List<Task>();
    }

    public string IsWorkingOn()
    {
      string result = "";
      foreach (Task task in CurrentTasks)
      {
        result += task.Name + ",";
      }
      if (result == "")
      {
        return Labels.Nothing;
      }
      return result.Substring(0, result.Length - 1);
    }

    public string WillWorkOn()
    {
      string result = "";
      foreach (Task task in NextTasks)
      {
        result += task.Name + ",";
      }
      if (result == "")
      {
        return Labels.Nothing;
      }
      return result.Substring(0, result.Length - 1);
    }
  }
}
